how to find complementary function